def parse_week_ranges(week_str):
    """
    将周次字符串转换为数字数组
    示例：
    "2-7,9-13" → [2,3,4,5,6,7,9,10,11,12,13]
    "14" → [14]
    "2-16,18" → [2,3,...,16,18]
    """
    result = []

    # 分割多个区间
    parts = week_str.split(',')
    for part in parts:
        # 处理单个数字
        if '-' not in part:
            result.append(int(part))
            continue

        # 处理区间范围
        start, end = map(int, part.split('-'))
        result.extend(range(start, end + 1))

    return result


